Repository navigation
feat(live): custom org templates, Indonesian built-ins, safe domain removal - #24
Merged
Merged
Conversation
…emoval
- Trainers can remove a verified domain in their own organization. Removal
is refused (409) while an active campaign or recurring schedule still sends
from or to that domain. Previously the endpoint was admin-only but not
scoped, and nothing checked for active use.
- Custom phishing templates per organization: GET/POST/DELETE
/api/live/templates. A saved template must pass the same content checks
as pre-flight (G7, G9, G10, {{.URL}} for click_link). Built-ins cannot
be deleted.
- seed_templates upserts built-ins by id, so templates added in a release
reach instances seeded earlier. Adds three Indonesian built-ins and a
language field on every template.
- Campaign form: templates grouped (organization / ID / EN), an EN/ID
language selector filled from the template, save-as-template, delete for
custom templates, and a two-click delete on domains.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Domain removal
DELETE /api/live/domains/{id}is now available to trainers and scoped to their organization. Before this change it was admin-only, but an admin could delete any organization's domain.pending_approval,approved,launching,running) or an active recurring schedule still sends from or to the domain or one of its subdomains. A running campaign keeps the verification it was approved under.Custom templates (per organization)
POST /api/live/templatessaves a custom template, andDELETE /api/live/templates/{id}removes one. Built-ins cannot be deleted (400).GETreturns the built-in templates plus the caller's organization templates. Admins see all.{{.URL}}forclick_link). A saved template can therefore never be one that pre-flight blocks.Built-in templates
seed_templatesupserts built-ins by id. Previously it seeded only when the collection was empty, so new templates never reached existing instances.languagefield on every template.Campaign form
Tests
backend/tests/test_live.pycover:ruff checkandruff format --checkare clean.CI=true npm run buildpasses.🤖 Generated with Claude Code